package cn.tedu.carhome.controller;

import cn.tedu.carhome.mapper.StockMapper;
import cn.tedu.carhome.mapper.SupplierMapper;
import cn.tedu.carhome.mapper.UserMapper;
import cn.tedu.carhome.ex.ServiceException;
import cn.tedu.carhome.pojo.dto.InsertStockDTO;
import cn.tedu.carhome.pojo.dto.InsertStockHeadDTO;
import cn.tedu.carhome.pojo.entity.Drug;
import cn.tedu.carhome.pojo.entity.User;
import cn.tedu.carhome.service.AddStockService;
import cn.tedu.carhome.web.JsonResult;
import cn.tedu.carhome.web.State;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
public class StockController {
    @Autowired(required = false)
    AddStockService service;

    @RequestMapping("/stock/insert")
    public JsonResult<Void> addStock(@RequestBody InsertStockHeadDTO insertStockHeadDTO) {
        service.addStock(insertStockHeadDTO);
        return JsonResult.ok();
    }


}
